home *** CD-ROM | disk | FTP | other *** search
/ Programming an RTS Game with Direct3D / Programming an RTS Game with Direct3D.iso / Examples / Chapter 5 / Example 5.10 / shader.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-06-29  |  718 b   |  36 lines

  1. #ifndef CJ_SHADER
  2. #define CJ_SHADER
  3.  
  4. #include <d3dx9.h>
  5. #include "debug.h"
  6.  
  7. #define PIXEL_SHADER 0
  8. #define VERTEX_SHADER 1
  9.  
  10. class SHADER{
  11.     public:
  12.         SHADER();
  13.         ~SHADER();
  14.         void Init(IDirect3DDevice9 *Dev, const char fName[], int typ);
  15.  
  16.         D3DXHANDLE GetConstant(char name[]);
  17.  
  18.         void SetFloat(D3DXHANDLE h, float f);
  19.         void SetVector3(D3DXHANDLE h, D3DXVECTOR3 v);
  20.         void SetVector4(D3DXHANDLE h, D3DXVECTOR4 v);
  21.         void SetMatrix(D3DXHANDLE h, D3DXMATRIX m);
  22.  
  23.         void Begin();
  24.         void End();
  25.  
  26.     private:
  27.  
  28.         int m_type;
  29.         IDirect3DDevice9 *m_pDevice;
  30.         IDirect3DPixelShader9 *m_pPixelShader;
  31.         IDirect3DVertexShader9 *m_pVertexShader;
  32.         ID3DXConstantTable *m_pConstantTable;
  33. };
  34.  
  35.  
  36. #endif